package com.bruce.codeFactory.Thread.lock;

import java.util.Collection;

/**
 * @author luotuan
 * @Description 自定义的锁
 * @create 2019-02-19 22:54
 **/
public interface Lock {
    class TimeoutException extends Exception {
        public TimeoutException(String message) {
            super(message);
        }
    }

    void lock() throws InterruptedException;

    void lock(long mills) throws InterruptedException, TimeoutException;

    void unlock();

    Collection<Thread> getBlockedThread();

    int getBlockedSize();
}
